Let the slider use the physical scroll direction, unaffected
by "natural scroll" settings. These widgets are not a "view"
where this setting does make sense, but rather the expectation
is that it's directly manipulable.
Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/1012
Closes: https://bugzilla.gnome.org/show_bug.cgi?id=703046
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3831>
} else if (direction === Clutter.ScrollDirection.UP) {
delta = SLIDER_SCROLL_STEP;
} else if (direction === Clutter.ScrollDirection.SMOOTH) {
- let [, dy] = event.get_scroll_delta();
- // Even though the slider is horizontal, use dy to match
- // the UP/DOWN above.
- delta = -dy * SLIDER_SCROLL_STEP;
+ let [dx] = event.get_scroll_delta();
+ delta = dx * SLIDER_SCROLL_STEP;
+ // Match physical direction
+ if (event.get_scroll_flags() & Clutter.ScrollFlags.INVERTED)
+ delta *= -1;
}
this.value = Math.min(Math.max(0, this._value + delta), this._maxValue);